package models;

import java.lang.reflect.*;
import com.google.gson.*;

public class CircleSerializer implements JsonSerializer<Circle> {

	public JsonElement serialize(Circle c, Type typeOfPost, JsonSerializationContext context) {
		JsonObject obj = new JsonObject();
		
		obj.addProperty("id", c.id);
		obj.addProperty("company", c.company);
		obj.addProperty("name", c.name);
		obj.addProperty("location", c.location);
		obj.addProperty("createDate", c.createDate.toString());
		obj.addProperty("lat", c.lat);
		obj.addProperty("lng", c.lng);
		obj.addProperty("hasPhoto", c.hasPhoto());
		obj.addProperty("hasMap", c.hasMap());
		obj.addProperty("tagsStr", c.getTagsString());
		obj.addProperty("postsNum", c.getPostNumber());
		obj.addProperty("membersNum", c.getMemberNumber());
		
		
		return obj;
	}
}